1. Field of the Invention
The present invention relates to an apparatus for coding and decoding digital image data and, more particularly, to an apparatus for variable-length-coding digital data and variable-length-decoding the variable-length-coded data using a plurality of Huffman code tables.
The instant application is based on Korean Patent Application No. 94-31360, which is incorporated herein by reference for all purposes.
2. Description of Related Art
Generally, systems for compressing and reconstructing image data reduce the amount of data to be transmitted by using methods such as Discrete Cosine Transform (DCT) quantization and Differential Pulse Code Modulation (DPCM), i.e., Lossy Encoding methods. A large amount of data is compressed by means by variable-length-coding, i.e., Lossless Encoding.
In the variable-length-coding, "run".multidot."level" is proposed by zigzag-scanning quantized transformation coefficients, and symbols made of "run".multidot."level" are replaced with codewords derived using a Huffman code. Usually, the term "run" denotes the number of coefficients which continuously have values of "0", and the "level" is a value of a coefficient following coefficient(s) having a value of "0". In case of representing one symbol by the run and level, a high value of the run and level indicates a low statistical probability of the symbol's occurrence. Huffman coding in variable-length-coding allocates codes of differing lengths according to the probability of occurrence of a predetermined symbol. That is, the key idea of Huffman coding is to use a shorter codeword for a symbol with more frequent occurrences. A Huffman coding device is designed to estimate the probability of symbol occurrence for each symbol and to act as follows: the higher probabilities are assigned the shorter codewords while the lower probabilities of symbol occurrence are assigned the longer codewords.
FIG. 1 is a block diagram showing a conventional variable-length-coding apparatus using a Huffman code. The variable-length-coding apparatus is designed to use one predetermined Huffman code table 13. The Huffman code table 13 is composed of different length codes according to the probabilities of occurrence of the predetermined symbols in the input data. That is, the higher the probability of run-level data is, the shorter the codeword length. In actual practice, the statistics of the input data can vary, which can result in inefficient coding of the input symbols. In other words, inefficient coding results when a symbol having a relatively high probability of occurrence is coded with a relatively long codeword, and a symbol having a relatively low probability of occurrence is coded with a relatively short codeword. In order to eliminate this problem associated with a change in the statistics of the input data, the Huffman code table must be rearranged, and the rearranged table transmitted to the decoder. Thus, inefficient coding results in reduced data compression efficiency, and rearranging and retransmitting the rearranged table results in increased overhead.
Furthermore, a variable-length-coding method using, selectively, two Huffman code tables has been proposed by the Motion Picture Experts Group (MPEG), but this technique causes a reduction in the compression efficiency according to the characteristics of the video signal, since each of the Huffman code tables is selected irrespective of the occurrence of the variable-length-coded (VLC) data. Variable-length image coding systems which respectively perform variable-length-coding of signals input through multi-channels are disclosed in U.S. Pat. No. 5,319,457 to Nakahashi et al. The variable-length image coding system codes multi-channel parallel data and then multiplexes the coded data so as to transmit it at a specified speed. The coders are selected based on the number of bits obtained by different variable-length coders for every channel to thereby transmit the VLC data at the specified speed.